package com.zenithmind.user.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.Min;

import java.time.LocalDateTime;

/**
 * 租户创建DTO
 * 
 * @author ZenithMind
 * @since 2024-06-30
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "租户创建请求对象")
public class TenantCreateDTO {

    @NotBlank(message = "租户编码不能为空")
    @Size(min = 3, max = 50, message = "租户编码长度必须在3到50之间")
    @Schema(description = "租户编码（唯一标识）", example = "company001")
    private String tenantCode;

    @NotBlank(message = "租户名称不能为空")
    @Size(min = 2, max = 100, message = "租户名称长度必须在2到100之间")
    @Schema(description = "租户名称", example = "示例公司")
    private String tenantName;

    @Schema(description = "租户类型（1-企业版，2-个人版，3-试用版）", example = "1")
    private Integer tenantType = 1;

    @Size(max = 100, message = "域名长度不能超过100个字符")
    @Schema(description = "租户域名", example = "company.zenithmind.com")
    private String domain;

    @Schema(description = "租户Logo URL")
    private String logo;

    @NotBlank(message = "联系人姓名不能为空")
    @Size(max = 50, message = "联系人姓名长度不能超过50个字符")
    @Schema(description = "联系人姓名", example = "张三")
    private String contactName;

    @Size(max = 20, message = "联系人电话长度不能超过20个字符")
    @Schema(description = "联系人电话", example = "13800138000")
    private String contactPhone;

    @NotBlank(message = "联系人邮箱不能为空")
    @Email(message = "联系人邮箱格式不正确")
    @Size(max = 100, message = "联系人邮箱长度不能超过100个字符")
    @Schema(description = "联系人邮箱", example = "admin@company.com")
    private String contactEmail;

    @Size(max = 500, message = "租户地址长度不能超过500个字符")
    @Schema(description = "租户地址")
    private String address;

    @Schema(description = "到期时间")
    private LocalDateTime expireTime;

    @Min(value = 1, message = "最大用户数必须大于0")
    @Schema(description = "最大用户数", example = "100")
    private Integer maxUsers = 100;

    @Min(value = 0, message = "存储配额不能为负数")
    @Schema(description = "存储配额（字节）", example = "10737418240")
    private Long storageQuota = 10737418240L; // 默认10GB

    @Schema(description = "功能特性配置（JSON格式）")
    private String features;

    @Schema(description = "租户设置（JSON格式）")
    private String settings;

    @Schema(description = "管理员用户名", example = "admin")
    private String adminUsername;

    @Schema(description = "管理员密码", example = "123456")
    private String adminPassword;

    @Schema(description = "管理员邮箱", example = "admin@company.com")
    private String adminEmail;
}
